import wx
try:
    from . import image
except ImportError:
    import image


class Book_null(wx.StaticBitmap):
    def __init__(self, parent, file_name, Null_type, **k):
        wx.StaticBitmap.__init__(self, parent, **k)
        self.mimage = image._img_null.GetImage()
        self.Bind(wx.EVT_SIZE, self.on_size)
        self.Bind(wx.EVT_CLOSE, self.on_close)

    def on_close(self, eve):
        self.Destroy()

    def on_size(self, eve):
        img = self.mimage.Scale(eve.Size[0],eve.Size[1])
        self.SetBitmap(wx.Bitmap(img))
        eve.Skip()



def main():
    app = wx.App()
    ex = wx.Frame(None)
    Book_null(ex, "jpg.jpg",wx.BITMAP_TYPE_JPEG)
    ex.Show()
    app.MainLoop()


if __name__ == '__main__':
    main()